#include "dll_prj.h"
#include "qdebug.h"
#include "qtcpsocket.h"
#include <QApplication>
#include <QWidget>

class MainTest {

public:
    static MainTest& getInstance()
    {
        static MainTest instance;
        return instance;
    }

private:
    MainTest()
    {
        qDebug() << "Enter the MainTest constructor";
    }
    ~MainTest()
    {
        //exe中的可以析构
        qDebug() << "Enter the MainTest destructor";
    }
};

int main(int argc, char* argv[])
{
    QApplication a(argc, argv);
    QTcpSocket sock;
    //网络不可达无法析构
    sock.connectToHost("192.168.11.1", 8081);
    //端口不可达可以析构
    //sock.connectToHost("127.0.0.1", 8081);
    DllTest::getInstance();
    MainTest::getInstance();
    QWidget w;
    w.show();
    return a.exec();
}
